<template>
  <div class="control-panel">
    <h2>Control Panel</h2>
    <div class="control-group">
      <button @click="addReplicaGroup" class="add-group-btn">
        + Add Replica Group
      </button>
    </div>
  </div>
</template>

<script setup>
import { useTrainingStore } from '../stores/training'

const store = useTrainingStore()

function addReplicaGroup() {
  const newGroupId = Math.max(...Object.keys(store.replicaGroups).map(Number)) + 1
  store.addReplicaGroup(newGroupId)
}
</script>

<style scoped>
.control-panel {
  padding: 15px;
  border-bottom: 1px solid #e8e8e8;
}

h2 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.1rem;
  color: #333;
}

.add-group-btn {
  width: 100%;
  padding: 10px;
  background-color: #1890ff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.2s;
}

.add-group-btn:hover {
  background-color: #40a9ff;
}
</style>